<template>
  <div id="app">
    <router-view />
  </div>
</template>

<script setup>
import { onMounted } from 'vue'
import { useDocumentStore } from '@/store/document'
import { useProjectStore } from '@/store/project'

// 初始化数据
const documentStore = useDocumentStore()
const projectStore = useProjectStore()

onMounted(() => {
  // 初始化模拟数据
  documentStore.initializeMockData()
  // 合并加载外部清单（作为数据源之一）
  documentStore.loadFromManifest()
  projectStore.initializeMockData()
})
</script>

<style lang="scss">
// 全局样式重置
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
}

#app {
  height: 100vh;
  color: var(--el-text-color-primary);
  background-color: var(--el-bg-color-page);
}

// 自定义滚动条
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: var(--el-fill-color-lighter);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb {
  background: var(--el-fill-color);
  border-radius: 3px;
  
  &:hover {
    background: var(--el-fill-color-dark);
  }
}

// Element Plus 样式定制
.el-menu {
  border-right: none !important;
}

.el-header {
  border-bottom: 1px solid var(--el-border-color-light);
}

.el-aside {
  border-right: 1px solid var(--el-border-color-light);
}
</style>